<template>
  <div>
    <div style="margin:10px">分配明细</div>
    <el-table
      :loading="false"
      :table-height="300"
      :data="formItem"
      :disable-pageable="true"
      class="fixed-table-table"
    >
      <el-table-column
        label="序号"
        type="index"
        width="50"
      />
      <el-table-column v-for="column in insideColumns2" :key="column.key" :label="column.title" :prop="column.key" :sortable="column.sortable">
        <template slot-scope="scope">
          <column-render :render="column.render" :row="scope.row" :column="column" />
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
import { distributeDetail as detail } from '@neu/dcam-ui/api/lingyongKJ'
// import PageableTable from '@neu/biz-core/components/PageableTable'

export default {
  components: {
    // PageableTable
  },
  props: {
    taskId: {
      required: false,
      type: String,
      default: 'NULL'
    },
    workOrderNum: {
      required: false,
      type: String,
      default: ''
    }
  },
  data() {
    return {
      formItem: [],
      insideColumns2: [
        { title: '资产名称', width: 100, key: 'name' },
        { title: '资产编号', width: 120, key: 'code' },
        { title: '大分类', width: 100, key: 'bigTypeName' },
        { title: '中分类', width: 100, key: 'middleTypeName' },
        { title: '小分类', width: 100, key: 'smallTypeName' },
        { title: '规格型号', width: 100, key: 'specifications' },
        { title: '序列号', width: 100, key: 'serialnumber' },
        { title: '位置', width: 100, key: 'lingyongLocationName' },
        { title: '使用人', width: 100, key: 'managementUserName' }
      ],
      rules: {}
    }
  },
  created() {
    this.fetch()
  },
  methods: {
    fetch() {
      if (this.workOrderNum !== 'NULL') {
        detail(this.workOrderNum, this.taskId).then(response => {
          this.formItem = [...response.data.lingyong]
        })
      }
    }
  }
}
</script>
